import React from "react";


class CommentBox extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      value: ""
    }
    this.handleSubmit = this.handleSubmit.bind(this)
  }


  handleSubmit(event) {
    alert(this.textInput.value)
    event.preventDefault()
  }
  render() {
    return (
      <form action="" onSubmit={this.handleSubmit}>
        <div>
          <p>留言板</p>
          <input type="text" placeholder="请输入内容" ref={textInput => { this.textInput = textInput }} />
        </div>
        <button type="submit">留言</button>
      </form>
    )
  }

}

export default CommentBox 